package cn.tedu.spring.bean;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

@Service
public class UserService {
    /*
    Autowired:

     */
    @Value("注册业务")
    private String name;
    //@Autowired
    private UserDao userDao;
//@Autowired  //构造方法注入
    public UserService(UserDao userDao) {
        this.userDao = userDao;
    }
@Autowired //set注入
    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    @Override
    public String toString() {
        return "UserService{" +
                "name='" + name + '\'' +
                ", userDao=" + userDao +
                '}';
    }
}
